import axios from 'axios'
import { baseURL } from './api'

export const sendActionGet = (url,params='')=>{
    return new Promise((resolve,reject)=>{
        axios.request({
            url:baseURL+url,
            method:"GET",
            data:params
        }).then((res)=>{
            resolve(res.data)
        }).catch((err)=>{
            reject(err)
        })
    })
}

export const sendActionPost = (url,data={})=>{
    return new Promise((resolve,reject)=>{
        axios.request({
            url:baseURL+url,
            method:"POST",
            data
        }).then((res)=>{
            resolve(res)
        }).catch((err)=>{
            reject(err)
        })
    })
}